home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Amiga Collections: Auge 4000
/
Auge 4000 #54 (1991-04-07)(Amiga User Gruppe Einzugsgebiet 4000).zip
/
Auge 4000 #54 (1991-04-07)(Amiga User Gruppe Einzugsgebiet 4000).adf
/
PopUpMenu
/
Source
/
AltStartup.a
next >
Wrap
Text File
|
1991-04-07
|
2KB
|
99 lines
INCLUDE "exec/types.i"
INCLUDE "libraries/dos.i"
INCLUDE "libraries/dosextens.i"
INCLUDE "exec/execbase.i"
INCLUDE "exec/funcdef.i"
INCLUDE "exec/exec_lib.i"
INCLUDE "libraries/dos_lib.i"
AbsExecBase EQU 4
POPUPPRI EQU 5
POPUPSTACK EQU 2000
* Must use Kickstart 1.2 or higher
LIBVERSION EQU 33
xref _LinkerDB
xref @InitPopUpMenu
section text,code
Startup: MOVEM.L D2-D4/A2-A4/A6,-(SP)
LEA _LinkerDB,A4
* ------------ Open dos.
LEA DosName(PC),A1
MOVEQ.L #LIBVERSION,D0
MOVEA.L AbsExecBase.W,A6
JSR _LVOOpenLibrary(A6)
MOVE.L D0,_DOSBase(A4)
TST.L D0
BEQ.W NoDos
* ------------ Get pointer to our Process.
MOVEA.L ThisTask(A6),A3
* ------------ Find current output window.
LEA CurrWindow(PC),A0
MOVE.L #MODE_OLDFILE,D2
* ------------ Run from Workbench ?
TST.L pr_CLI(A3)
BNE.B FromCLI
* ------------ Wait for Workbench startup-message.
LEA pr_MsgPort(A3),A0
JSR _LVOWaitPort(A6)
LEA pr_MsgPort(A3),A0
JSR _LVOGetMsg(A6)
MOVE.L D0,D3
* ------------ Open window on Workbench screen.
LEA WbWindow(PC),A0
MOVE.L #MODE_NEWFILE,D2
FromCLI: MOVE.L A0,D1
MOVEA.L _DOSBase(A4),A6
JSR _LVOOpen(A6)
MOVE.L D0,_StdOut(A4)
MOVEA.L AbsExecBase.W,A6
TST.L D0
BEQ.B NoStdOut
* ------------ Don't unload segments.
CLR.L _PopUpSeg(A4)
* ------------ Set task priority.
MOVEA.L A3,A1
MOVEQ #POPUPPRI,D0
JSR _LVOSetTaskPri(A6)
* ------------ Start PopUpMenu-program. (PC - relative is ok, same hunk)
JSR @InitPopUpMenu(PC)
* ------------ Must reply if started from workbench.
NoStdOut: TST.L pr_CLI(A3)
BNE.B Done
JSR _LVOForbid(A6)
MOVEA.L D3,A1
JSR _LVOReplyMsg(A6)
Done:
NoDos: MOVEQ #0,D0
MOVEM.L (SP)+,D2-D4/A2-A4/A6
RTS
* Put these data in our code-segment.
CurrWindow: dc.b '*',0
WbWindow: dc.b 'CON:200/75/310/45/PopUpMenu',0
DosName: dc.b 'dos.library',0
section __MERGED,bss
xref _DOSBase
xref _StdOut
xref _PopUpSeg
END